<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
  //其他类型经常需要转化成字符串类型，比如和字符串拼接在一起或者使用字符穿法中方法
  //1.隐式转化
var num1=123
var age=18
var isAdmin=true
//转化方式一：隐式转化
  var numStr=num1+""
  var numStr1=age+""
  var numStr2=isAdmin+""
  console.log(numStr,numStr1,numStr2)
  console.log(typeof numStr,typeof numStr1,typeof numStr2)
  //转化方式二：显示转化
  var num1Str2=String(num1)
  var num2Str2=String(age)
  var num3Str3=String(isAdmin)
  console.log(num1Str2,num2Str2,num3Str3)
  console.log(typeof num1Str2,typeof num2Str2,typeof num3Str3)
  </script>
</body>
</html>